Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply unsafe_op_in_unsafe_fn to the standard library #136986

Merged
merged 8 commits into from
Feb 17, 2025

Conversation

ehuss
Copy link
Contributor

@ehuss ehuss commented Feb 13, 2025

This applies unsafe_op_in_unsafe_fn to the standard library in preparation for updating to Rust 2024.

Closes #127747 (I think?) cc @workingjubilee
I have been testing a variety of targets, and I feel like they are all pretty much covered. I'll continue doing some testing async, but I don't expect to catch any more.

@rustbot
Copy link
Collaborator

rustbot commented Feb 13, 2025

r? @Noratrieb

rustbot has assigned @Noratrieb.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added O-windows Operating system: Windows S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Feb 13, 2025
@rustbot
Copy link
Collaborator

rustbot commented Feb 13, 2025

Some changes occurred to the intrinsics. Make sure the CTFE / Miri interpreter
gets adapted for the changes, if necessary.

cc @rust-lang/miri, @rust-lang/wg-const-eval

@rust-log-analyzer

This comment has been minimized.

@workingjubilee
Copy link
Member

Thanks for the PR! Looks like miri needs your blessings

@rustbot
Copy link
Collaborator

rustbot commented Feb 13, 2025

The Miri subtree was changed

cc @rust-lang/miri

@rust-log-analyzer

This comment has been minimized.

@ehuss
Copy link
Contributor Author

ehuss commented Feb 14, 2025

Fixing miri looks like it will be non-trivial (it seems to have some sensitivity to the target). I may not be able to get back to this for a couple days.

@RalfJung
Copy link
Member

Yeah these tests have some careful;y chosen normalization patterns as they show code spans from the standard library that can differ between targets.

But the CI failure is due to code in library/panic_unwind/src/miri.rs:24:32 that only gets built for Miri and that still needs some more unsafe blocks. If you have a local fix for the code, could you push that? I can help updating the test files.

@ehuss ehuss force-pushed the library-unsafe-fun branch from 35ca558 to 2830755 Compare February 14, 2025 15:36
@ehuss
Copy link
Contributor Author

ehuss commented Feb 14, 2025

OK, I found a few minutes this morning to look at this. I updated the miri tests with what I think is the correct way to bless it. All the checktools.sh targets seem to pass. @RalfJung please let me know if it looks ok.

@RalfJung
Copy link
Member

Miri diff LGTM :)

@Noratrieb
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Feb 16, 2025

📌 Commit 2830755 has been approved by Noratrieb

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 16, 2025
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Feb 16, 2025
Apply unsafe_op_in_unsafe_fn to the standard library

This applies unsafe_op_in_unsafe_fn to the standard library in preparation for updating to Rust 2024.

Closes rust-lang#127747 (I think?) cc `@workingjubilee`
I have been testing a variety of targets, and I feel like they are all pretty much covered. I'll continue doing some testing async, but I don't expect to catch any more.
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 16, 2025
…iaskrgr

Rollup of 9 pull requests

Successful merges:

 - rust-lang#125087 (Optimize `Seek::stream_len` impl for `File`)
 - rust-lang#136986 (Apply unsafe_op_in_unsafe_fn to the standard library)
 - rust-lang#137012 (add docs and ut for bootstrap util cc-detect)
 - rust-lang#137072 (Load all builtin targets at once instead of one by one in check-cfg)
 - rust-lang#137102 (Rework `name_regions` to not rely on reverse scc graph for non-member-constrain usages)
 - rust-lang#137112 (Don't project into `NonNull` when dropping a `Box`)
 - rust-lang#137114 (Add an example for `std::error::Error`)
 - rust-lang#137117 (Fix test that relies on error language)
 - rust-lang#137119 (fix broken `x {doc, build} core`)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 16, 2025
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#136986 (Apply unsafe_op_in_unsafe_fn to the standard library)
 - rust-lang#137012 (add docs and ut for bootstrap util cc-detect)
 - rust-lang#137072 (Load all builtin targets at once instead of one by one in check-cfg)
 - rust-lang#137102 (Rework `name_regions` to not rely on reverse scc graph for non-member-constrain usages)
 - rust-lang#137112 (Don't project into `NonNull` when dropping a `Box`)
 - rust-lang#137114 (Add an example for `std::error::Error`)
 - rust-lang#137117 (Fix test that relies on error language)
 - rust-lang#137119 (fix broken `x {doc, build} core`)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 53b4c7c into rust-lang:master Feb 17, 2025
6 checks passed
@rustbot rustbot added this to the 1.87.0 milestone Feb 17, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Feb 17, 2025
Rollup merge of rust-lang#136986 - ehuss:library-unsafe-fun, r=Noratrieb

Apply unsafe_op_in_unsafe_fn to the standard library

This applies unsafe_op_in_unsafe_fn to the standard library in preparation for updating to Rust 2024.

Closes rust-lang#127747 (I think?) cc ``@workingjubilee``
I have been testing a variety of targets, and I feel like they are all pretty much covered. I'll continue doing some testing async, but I don't expect to catch any more.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-windows Operating system: Windows S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fixing unsafe_op_in_unsafe_fn for std::{os, sys}
7 participants